<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>登陆--首页</title>
<!--[if lt IE 9]>
  <script src="libs/html5shiv.min.js"></script>
  <script src="libs/respond.min.js"></script>
  <![endif]-->
<script type="text/javascript" src="libs/handlebars.min.js"></script>
<script src="libs/jquery-1.12.1.min.js"></script>
<script src="libs/getQueryString.js"></script>
<link href="libs/bootstrap-3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="page-header">
				<h2>
					<strong>小超记账</strong>
				</h2>
			</div>
		</div>
	</div>

	<div class="container">
		<div class="row">
			<div class="col-md-8">
				<ul class="nav nav-pills pull-right">
					<li role="presentation" class="active"><a href="index.html">首页</a></li>

					<li role="presentation"><a href="adda.html">添加档案</a></li>
					<li role="presentation"><a href="query.html">统计</a></li>
					<li role="presentation"><a href="select.html">查询</a></li>
					<li><a href="#">用户：<span id="text3"></span></a></li>
				</ul>
				<div class="col-md-12">
					<button id="query_null">退出</button>
					<div class="row">
						<div class="panel panel-warning">
							<div class="col-md-12">
								<div class="panel panel-success">
									<div class="panel-heading">查询详情</div>

									<div class="panel-body" id="list1"></div>
								</div>
							</div>
						</div>






						<script id="template" type="text/x-handlebars-template">
	{{#each item}}
		<div class="panel panel-default col-md-6">
			<div class="panel-body">
				<dl>
                    <dt>id</dt><dd>{{id}}</dd>
                    <dt>人的</dt><dd>{{user_id}}</dd>
					<dt>时间</dt><dd>{{date_time}}</dd>
					<dt>地点</dt><dd>{{place}}</dd>
					<dt>收入</dt><dd>{{money_in}}</dd>
                    <dt>支出</dt><dd>{{money_out}}</dd>
					<dt>类别</dt><dd>{{kind}}</dd>
                    <dt>备注</dt><dd>{{remark}}</dd>
                     <button id="querydel" >删除</button>
				</dl>
			</div>
		</div>
	{{/each}}
</script>

						<script type="text/javascript">
							$(function() {
								var id = getQueryString("id");
								$
										.getJSON(
												'querytwo.action?id=' + id,
												function(res) {
													console.log(res);
													var data = {
														'item' : res
													};
													var t = Handlebars
															.compile($(
																	'#template')
																	.html());
													$('#list1').html(t(data));
													$('#querydel')
															.click(
																	function() {
																		$
																				.post(
																						'querydel.action',
																						{
																							id : id
																						},
																						function(
																								res,
																								status) {
																							window.location.href = "select.html";
																						})
																	})
												})
							})
						</script>
</body>
</html>